<?php

?>
<style>
    .crossborder {
        padding: .04rem .15rem;
        height: .4rem;
        color: #FFFFFF;
        text-align: center;
        background: #E30038;
        border-radius: .1rem;
        line-height: .3rem;
        margin-right: .1rem;
    }
</style>
<div class="table-responsive">
    <table id="goodslisttable" class="table table-bordered table-hover table-condensed" style=" margin-top: 5px">
        <thead class="nowrap">
        <tr>
            <th style="width:20%">商品编码</th>
            <th style="width:20%">商品图片</th>
            <th style="width:40%">商品名称</th>
            <th style="width:10%">商品销售价</th>
            <th style="width:10%">商品品牌</th>
            <th style="width:10%">
                <input type="button" value="全选" onclick="goodsAllSelectSet(1)">
                <input type="button" value="全取消" onclick="goodsAllSelectSet(0)">
            </th>
            <th style="width:10%">首页显示</th>
        </tr>
        </thead>
        <tbody>
        <?php
            foreach($goodslist as $item) {
                ?>
                <tr>
                    <td><?= $item['code'] ?></td>
                    <td  align="center" style="vertical-align:middle;">
                        <a href="javascript:void(0)" class="tooltips" rel="<?= $item['image_url'] ?>" target="_blank" >
                            <img src="<?= $item['image_url'] ?>" style="width: 3rem; height: 3rem;">
                        </a>
                    </td>
                    <td>
                        <?php
                        if($item['is_crossborder']=='1'){
                            ?>
                            <span class="crossborder">跨境</span>
                            <?php
                        }
                        ?>
                        <?= $item['name'] ?></td>
                    <td><?= $item['selling_price'] ?></td>
                    <td><?= $item['brand'] ?></td>
                    <td align="center">
                        <input type="hidden" name ="code" value="<?= $item['code'] ?>">
                        <input type="hidden" name ="institution_code" value="<?= $item['institution_code'] ?>">
                        <input type="checkbox" name="checkbox_is_hide" value="<?= $item['code'] ?>" onclick="goodsSelectdSet(this)" <?php if ($item["is_hide"] == 1) echo "checked"; ?>>
                    </td>
                    <td>
                        <input type="checkbox" name="checkbox_is_index_show"
                               onclick="goodsIsIndexShowSet(this,'<?= $item['code'] ?>','<?= $item['institution_code'] ?>')"
                            <?php if ($item["is_hide"] != 1) echo "disabled"; ?>
                            <?php if ($item["is_index_show"] == 1) echo "checked"; ?>>
                    </td>
                </tr>
                <?php
            }
        ?>
        </tbody>
    </table>
</div>